package com.wxb.controller;

import com.wxb.common.core.web.controller.BaseController;
import com.wxb.domain.MallTopicEntity;
import com.wxb.service.IMallTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Date 2025-05-27 15:00
 * @Version 1.0
 * @Description
 * @ClassName MallTopicController
 **/
@RestController
@RequestMapping("/topic")
public class MallTopicController extends BaseController {
    @Autowired
    private IMallTopicService topicService;

    @PostMapping("list")
    public Object list(MallTopicEntity topic) {
        startPage();
        //查询列表数据
        List<MallTopicEntity> list = topicService.queryList(topic);
        return getDataTable(list);
    }

    @PostMapping("detail")
    public Object detail(Integer id) {
        MallTopicEntity topicEntity = topicService.queryObject(id);
        return success(topicEntity);
    }

}
